package com.example.Film.reviews.website;

import com.example.Film.reviews.website.dao.DirectorRepository;
import com.example.Film.reviews.website.dao.MovieRepository;
import com.example.Film.reviews.website.dao.PerformerRepository;
import com.example.Film.reviews.website.entities.Director;
import com.example.Film.reviews.website.entities.Movie;
import com.example.Film.reviews.website.entities.Performer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.Arrays;

@SpringBootApplication
public class FilmReviewsWebsiteApplication {
//	@Autowired
//	MovieRepository movieRepository;
//	@Autowired
//	DirectorRepository directorRepository;
//	@Autowired
//	PerformerRepository performerRepository;

	public static void main(String[] args) {
		SpringApplication.run(FilmReviewsWebsiteApplication.class, args);
	}
//	@Bean
//	CommandLineRunner runner(){
//		return args -> {
//			Movie movie1 = new Movie("你好，李焕英","该片根据2016年的同名小品及贾玲亲身经历改编，讲述了刚考上大学的女孩贾晓玲经历了一次人生的大起大落后情绪失控，随后意外穿越回到了二十世纪八十年代，与20年前正值青春的母亲李焕英相遇的故事");
//
//			Director director1 = new Director("贾玲","20岁");
//
//			Performer performer1 = new Performer("沈腾","30岁");
//
//			director1.addMovie(movie1);
//
//			performer1.addMovie(movie1);
//
//			movie1.setDirectors(Arrays.asList(director1));
//			movie1.setPerformers(Arrays.asList(performer1));
//
//			movieRepository.save(movie1);
//			directorRepository.save(director1);
//			performerRepository.save(performer1);
//		};
//	}

}
